package com.simen.hellobytes;

import java.io.IOException;
import java.io.InputStream;
import java.net.Socket;

/**
 * author: SimenHi
 * create time: 2020-11-13 16:09
 * description:
 */
public class ReadClient extends Thread{
    private Socket socket;

    public ReadClient(Socket socket) {
        this.socket = socket;
    }

    @Override
    public void run() {
        try {
            InputStream inputStream=socket.getInputStream();

            IOUtil.printStreamContent(inputStream);

            IOUtil.closeSilently(inputStream);
            IOUtil.closeSilently(socket);
        } catch (IOException e) {
            e.printStackTrace();
        }


    }
}
